package com.hsq.spzx.common.exception;

import com.hsq.spzx.model.vo.common.ResultCodeEnum;
import lombok.Data;

/**
 * @author hsq
 * @date 2025-05-28 22:24
 */
@Data
public class HsqException extends RuntimeException{
    private Integer code;
    private String message;

    private ResultCodeEnum resultCodeEnum; // 封装错误状态码和错误消息

    public HsqException(ResultCodeEnum resultCodeEnum) {
        this.resultCodeEnum = resultCodeEnum ;
        this.code = resultCodeEnum.getCode() ;
        this.message = resultCodeEnum.getMessage();
    }

    public HsqException(Integer code , String message) {
        this.code = code ;
        this.message = message ;
    }
}
